<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <title>Document</title>
    <script src="/lib/vue.js"></script>
  </head>
  <body>
    <div id="app">
      10+20={{10+20}}
      <br />
      10>20:{{10>20 ? 'true':'false'}}
      <br />
      myname:{{myname}}
      <br />
      <!-- 指令 v-show -->
      <div v-show="isShow">我是动态的隐藏和显示</div>

      <button @click="handleClick()">我是动态的隐藏和显示</button>
      <!-- 指令 v-if 查看控制台 -->
      <div v-if="isCreate">我是动态创建和删除></div>
    </div>
    <script>
      var vm = new Vue({
        el: "#app",
        data() {
          return {
            myname: "vue.js",
            isShow: true,
            isCreate: true,
          };
        },
        methods: {
          handleClick() {
            this.isShow = !this.isShow;
            this.isCreate = !this.isCreate;
            // if (this.isShow) this.isShow = false;
            // else this.isShow = true;
          },
        },
      });
    </script>
  </body>
</html>
